package com.lijy.likebutton.util

import android.content.Context

/**
 *@time:     2020/11/30 0030
 *@author:   Lijy

 *@description:
 */

object DimenUtils {
    fun dp2px(context: Context, dp: Float): Float = dp * context.resources.displayMetrics.density

    fun px2dp(context: Context, px: Float): Float = px / context.resources.displayMetrics.density

    fun sp2px(context: Context, spValue: Float): Float = spValue * context.resources.displayMetrics.scaledDensity + 0.5f


}